package com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.AbstractTaskFormDataDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentModifyCloudDeviceDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentModifyDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentModifyServerDetailDto;
import com.glsc.ngateway.common.api.flowable.dto.task.formData.equipment.domainDto.FlowFormEquipmentModifyVirtualDeviceDetailDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import java.util.List;
import java.util.Objects;

/**
 * 设备流程-服务器系统变更流程表单数据
 * @author xuchang
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@EqualsAndHashCode(callSuper=true)
public class EquipmentModifyTaskFormDataDto extends AbstractTaskFormDataDto<FlowFormEquipmentModifyDto> {

    @ApiModelProperty(value = "子表-服务器设备")
    List<FlowFormEquipmentModifyServerDetailDto> formServerDataList;

    @ApiModelProperty(value = "子表-虚拟机")
    List<FlowFormEquipmentModifyVirtualDeviceDetailDto> formVirtualDeviceDataList;

    @ApiModelProperty(value = "子表-云平台")
    List<FlowFormEquipmentModifyCloudDeviceDetailDto> formCloudDeviceDataList;

    @Override
    public String getSystemAdminAccount() {
        return this.getFormMainData().getSystemAdminAccount();
    }

    @Override
    public String getProcessTitle() {
        return this.getFormMainData().getProcessTitle();
    }

    @Override
    public void setProcessId(String processId) {
        if(Objects.nonNull(this.getFormMainData())) {
            this.getFormMainData().setProcessId(processId);
        }
    }

    @Override
    public String getProcessId() {
        return this.getFormMainData().getProcessId();
    }

}
